#include <iostream>
#include <vector>

using namespace std;

int main() {
    string line1;
    // cin.getline()
    cin >> line1;
    cin.ignore();

    // parse TLV
    vector<string> TLV_vectors(3);
    while (cin.peek() != '\n') {
        // get tag and lenghth
        cin >> TLV_vectors[0];
        cin >> TLV_vectors[1];
        cin >> TLV_vectors[2];

        // get value
        int length = stoi(TLV_vectors[2] +TLV_vectors[1], 0, 16);
        string tmp;
        for (int i = 0; i < length; ++i) {
            cin >> tmp;
            TLV_vectors.push_back(tmp);
        }
        if (line1 == TLV_vectors[0]) {
            break;
        } else {
            TLV_vectors.clear();
            TLV_vectors = vector<string>(3);
        }
    }
    string output;
    for (int i = 3; i < TLV_vectors.size(); ++i) {
        // cout << TLV_vectors[i] << " ";
        output = output + TLV_vectors[i] + " "; 
    }
    output.pop_back();
    cout << output << endl;
}